// $ANTLR : "Anasint.g" -> "Anasint.java"$

	package procesador.tablas;

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;
import antlr.collections.AST;
import java.util.Hashtable;
import antlr.ASTFactory;
import antlr.ASTPair;
import antlr.collections.impl.ASTArray;

public class Anasint extends antlr.LLkParser       implements AnasintTokenTypes
 {

protected Anasint(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}

public Anasint(TokenBuffer tokenBuf) {
  this(tokenBuf,1);
}

protected Anasint(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}

public Anasint(TokenStream lexer) {
  this(lexer,1);
}

public Anasint(ParserSharedInputState state) {
  super(state,1);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}

	public final void entrada() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST entrada_AST = null;
		
		try {      // for error handling
			{
			_loop2461:
			do {
				if ((LA(1)==10)) {
					tabla();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop2461;
				}
				
			} while (true);
			}
			match(Token.EOF_TYPE);
			entrada_AST = (AST)currentAST.root;
			entrada_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(TABLAS,"TABLAS")).add(entrada_AST));
			currentAST.root = entrada_AST;
			currentAST.child = entrada_AST!=null &&entrada_AST.getFirstChild()!=null ?
				entrada_AST.getFirstChild() : entrada_AST;
			currentAST.advanceChildToEnd();
			entrada_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_0);
		}
		returnAST = entrada_AST;
	}
	
	public final void tabla() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST tabla_AST = null;
		
		try {      // for error handling
			match(10);
			AST tmp3_AST = null;
			tmp3_AST = astFactory.create(LT(1));
			astFactory.makeASTRoot(currentAST, tmp3_AST);
			match(IDENT);
			match(12);
			campos();
			astFactory.addASTChild(currentAST, returnAST);
			match(13);
			match(14);
			claves();
			astFactory.addASTChild(currentAST, returnAST);
			match(SALTO_LINEA);
			datos();
			astFactory.addASTChild(currentAST, returnAST);
			tabla_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
		returnAST = tabla_AST;
	}
	
	public final void campos() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST campos_AST = null;
		
		try {      // for error handling
			campo();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop2465:
			do {
				if ((LA(1)==16)) {
					match(16);
					campo();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop2465;
				}
				
			} while (true);
			}
			campos_AST = (AST)currentAST.root;
			campos_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(CAMPOS,"CAMPOS")).add(campos_AST));
			currentAST.root = campos_AST;
			currentAST.child = campos_AST!=null &&campos_AST.getFirstChild()!=null ?
				campos_AST.getFirstChild() : campos_AST;
			currentAST.advanceChildToEnd();
			campos_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
		returnAST = campos_AST;
	}
	
	public final void claves() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST claves_AST = null;
		
		try {      // for error handling
			AST tmp9_AST = null;
			tmp9_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp9_AST);
			match(IDENT);
			{
			_loop2470:
			do {
				if ((LA(1)==16)) {
					match(16);
					AST tmp11_AST = null;
					tmp11_AST = astFactory.create(LT(1));
					astFactory.addASTChild(currentAST, tmp11_AST);
					match(IDENT);
				}
				else {
					break _loop2470;
				}
				
			} while (true);
			}
			claves_AST = (AST)currentAST.root;
			claves_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(PRIMARYKEY,"PRIMARY_KEY")).add(claves_AST));
			currentAST.root = claves_AST;
			currentAST.child = claves_AST!=null &&claves_AST.getFirstChild()!=null ?
				claves_AST.getFirstChild() : claves_AST;
			currentAST.advanceChildToEnd();
			claves_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = claves_AST;
	}
	
	public final void datos() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST datos_AST = null;
		
		try {      // for error handling
			{
			_loop2473:
			do {
				if ((LA(1)==CADENA||LA(1)==NUMERO)) {
					registro();
					astFactory.addASTChild(currentAST, returnAST);
					match(SALTO_LINEA);
				}
				else {
					break _loop2473;
				}
				
			} while (true);
			}
			datos_AST = (AST)currentAST.root;
			datos_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(REGISTROS,"REGISTROS")).add(datos_AST));
			currentAST.root = datos_AST;
			currentAST.child = datos_AST!=null &&datos_AST.getFirstChild()!=null ?
				datos_AST.getFirstChild() : datos_AST;
			currentAST.advanceChildToEnd();
			datos_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
		returnAST = datos_AST;
	}
	
	public final void campo() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST campo_AST = null;
		
		try {      // for error handling
			AST tmp13_AST = null;
			tmp13_AST = astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp13_AST);
			match(IDENT);
			match(17);
			tipo();
			astFactory.addASTChild(currentAST, returnAST);
			campo_AST = (AST)currentAST.root;
			campo_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(CAMPO,"CAMPO")).add(campo_AST));
			currentAST.root = campo_AST;
			currentAST.child = campo_AST!=null &&campo_AST.getFirstChild()!=null ?
				campo_AST.getFirstChild() : campo_AST;
			currentAST.advanceChildToEnd();
			campo_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		returnAST = campo_AST;
	}
	
	public final void tipo() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST tipo_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case CHAR:
			{
				AST tmp15_AST = null;
				tmp15_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp15_AST);
				match(CHAR);
				tipo_AST = (AST)currentAST.root;
				break;
			}
			case NUMERIC:
			{
				AST tmp16_AST = null;
				tmp16_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp16_AST);
				match(NUMERIC);
				tipo_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		returnAST = tipo_AST;
	}
	
	public final void registro() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST registro_AST = null;
		
		try {      // for error handling
			atributo();
			astFactory.addASTChild(currentAST, returnAST);
			{
			_loop2476:
			do {
				if ((LA(1)==16)) {
					match(16);
					atributo();
					astFactory.addASTChild(currentAST, returnAST);
				}
				else {
					break _loop2476;
				}
				
			} while (true);
			}
			registro_AST = (AST)currentAST.root;
			registro_AST=(AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(REGISTRO,"REGISTRO")).add(registro_AST));
			currentAST.root = registro_AST;
			currentAST.child = registro_AST!=null &&registro_AST.getFirstChild()!=null ?
				registro_AST.getFirstChild() : registro_AST;
			currentAST.advanceChildToEnd();
			registro_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
		returnAST = registro_AST;
	}
	
	public final void atributo() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST atributo_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case CADENA:
			{
				AST tmp18_AST = null;
				tmp18_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp18_AST);
				match(CADENA);
				atributo_AST = (AST)currentAST.root;
				break;
			}
			case NUMERO:
			{
				AST tmp19_AST = null;
				tmp19_AST = astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp19_AST);
				match(NUMERO);
				atributo_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_5);
		}
		returnAST = atributo_AST;
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"TABLAS",
		"CAMPOS",
		"CAMPO",
		"REGISTROS",
		"REGISTRO",
		"PRIMARYKEY",
		"\"@\"",
		"IDENT",
		"\"(\"",
		"\")\"",
		"\":\"",
		"SALTO_LINEA",
		"\",\"",
		"\"/\"",
		"CHAR",
		"NUMERIC",
		"CADENA",
		"NUMERO"
	};
	
	protected void buildTokenTypeASTClassMap() {
		tokenTypeToASTClassMap=null;
	};
	
	private static final long[] mk_tokenSet_0() {
		long[] data = { 2L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
	private static final long[] mk_tokenSet_1() {
		long[] data = { 1026L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
	private static final long[] mk_tokenSet_2() {
		long[] data = { 8192L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
	private static final long[] mk_tokenSet_3() {
		long[] data = { 32768L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
	private static final long[] mk_tokenSet_4() {
		long[] data = { 73728L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
	private static final long[] mk_tokenSet_5() {
		long[] data = { 98304L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
	
	}
